<?php
namespace Home\Controller;
use Think\Controller;
vendor('taobao.TopSdk');//引入淘宝SDK

class 	FerightController extends Controller {
	
	public function __construct() {
		parent::__construct();
		if(empty($_SESSION['user']['id']))
		{
			$this->redirect('Home/Login/login');
		}
    }
	
	//查询快递公司
	public function feright_setting(){
		$visitor_id=empty($_REQUEST['visitor_id'])?0:$_REQUEST['visitor_id'];
		$btn_express=empty($_REQUEST['btn_express'])?'':$_REQUEST['btn_express'];
		$_SESSION['express']=empty($_SESSION['express'])?'5':$_SESSION['express'];
		
		
		
		$first_heavy=empty($_POST['first_heavy'])?'':$_REQUEST['first_heavy'];
		$first_heavy_feright=empty($_POST['first_heavy_feright'])?'':$_REQUEST['first_heavy_feright'];
		$continued_heavy_feright=empty($_POST['continued_heavy_feright'])?'':$_REQUEST['continued_heavy_feright'];
		$first_heavy=empty($_POST['feright_set'])?'':$_REQUEST['feright_set'];
		//查询快递
		$Express = D("print_template");
		$express_info=$Express->get_express_info($visitor_id);
		
		//查询目的地省份
		$Express = D("region");
		$region_info=$Express->get_region_info();
		
		//查询运费详细数据
		$region_id=empty($_REQUEST['region_id'])?'':$_REQUEST['region_id'];
		$print_id=empty($_REQUEST['print_id'])?'':$_REQUEST['print_id'];
		$first_heavy=empty($_REQUEST['first_heavy'])?'':$_REQUEST['first_heavy'];
		$first_heavy_feright=empty($_REQUEST['first_heavy_feright'])?'':$_REQUEST['first_heavy_feright'];
		$continued_heavy_feright=empty($_REQUEST['continued_heavy_feright'])?'':$_REQUEST['continued_heavy_feright'];
		$feright_set=empty($_REQUEST['feright_set'])?'':$_REQUEST['feright_set'];
		$feright_set=empty($_REQUEST['feright_set'])?'':$_REQUEST['feright_set'];
		
		$Region = D('Feright');
		$region_id=empty($_REQUEST['region_id'])?'5':$_REQUEST['region_id'];
		$template_list = $Region->get_template_list($region_id );
		var_dump($region_id);
		
		$this->assign('template_list',$template_list);
		


		
		$this->assign("express_info",$express_info);
		$this->assign("region_info",$region_info);
		$this->assign("feright_template",$feright_template);
		$this->assign("session",$session);

		$this->display();
    }
	
	/*
	public function template_list(){
		$Region = D('region');
		$region_list = $Region->get_template_list();
		$this->assign('region_list',$region_list);
		$this->display();
		}
	*/

	
	

		
}
















